<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='zhyyglhtxt'/></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
    <style>
        html {
            background: #fff;
        }
    </style>
</head>

<body>

<div class="layui-container">
    <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
        <form:form commandName="merchant" method="${_method }" class="layui-form" id="form">

            <input type="hidden" name="_method" value="${_method }"/>

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='zhxx'/></legend>
            </fieldset>

            <div class="layui-row layui-col-space30">

                <div class="layui-col-md6">

                    <div class="layui-form-item">
                        <label class="layui-form-label"><fmt:message key='zh'/></label>
                        <div class="layui-form-mid layui-word-aux">
                                ${merchant.username}
                        </div>
                    </div>

                </div>

            </div>


            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='jbxx'/></legend>
            </fieldset>

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='jysplm'/></label>
                <div class="layui-form-mid layui-word-aux">
                    <c:forEach items="${channels}" var="item">
                        ${item.channel.name}、
                    </c:forEach>
                </div>
            </div>

            <div class="layui-row layui-col-space30">

                <div class="layui-col-md6">

                    <div class="layui-form-item">
                        <label class="layui-form-label"><fmt:message key='dpmc'/></label>
                        <div class="layui-form-mid layui-word-aux">
                                ${merchant.shopName}
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><fmt:message key='lxrxm'/></label>
                        <div class="layui-form-mid layui-word-aux">
                                ${merchant.realName}
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><fmt:message key='yx'/></label>
                        <div class="layui-form-mid layui-word-aux">
                                ${merchant.email}
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><fmt:message key='lxdh'/></label>
                        <div class="layui-form-mid layui-word-aux">
                                ${merchant.mobile}

                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><fmt:message key='wx'/></label>
                        <div class="layui-form-mid layui-word-aux">
                                ${merchant.wechat}
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">QQ</label>
                        <div class="layui-form-mid layui-word-aux">
                                ${merchant.qq}
                        </div>
                    </div>

                </div>


                <div class="layui-col-md6">

                    <div class="layui-form-item">
                        <label class="layui-form-label"><fmt:message key='md'/>LOGO</label>
                        <div class="layui-form-mid layui-word-aux">
                            <c:if test="${not empty merchant.avatar}">
                                <img src="${store_domain}/uploads/${merchant.avatar}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                            </c:if>
                            <c:if test="${empty merchant.avatar}">
                                <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                            </c:if>
                        </div>
                    </div>


                </div>
            </div>


            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='kpxx'/></legend>
            </fieldset>

            <div class="layui-row layui-col-space30">

                <div class="layui-col-md6">

                    <div class="layui-form-item">
                        <label class="layui-form-label"><fmt:message key='fplx'/></label>
                        <div class="layui-form-mid layui-word-aux">
                            <c:choose>
                                <c:when test="${merchant.merchantInvoiceTitleType eq 1}"><fmt:message key='qy1'/></c:when>
                                <c:when test="${merchant.merchantInvoiceTitleType eq 2}"><fmt:message key='gr'/></c:when>
                            </c:choose>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><fmt:message key='fptt'/></label>
                        <div class="layui-form-mid layui-word-aux">
                                ${merchant.merchantInvoiceTitle }
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label"><fmt:message key='fpsh'/></label>
                        <div class="layui-form-mid layui-word-aux">
                                ${merchant.merchantInvoiceTFN }
                        </div>
                    </div>


                </div>

            </div>

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='xxxx'/></legend>
            </fieldset>

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='sjztlx'/></label>
                <div class="layui-form-mid layui-word-aux">
                    <c:choose>
                        <c:when test="${merchant.mainType eq 1}"><fmt:message key='qy1'/></c:when>
                        <c:when test="${merchant.mainType eq 2}"><fmt:message key='gth'/></c:when>
                        <c:when test="${merchant.mainType eq 3}"><fmt:message key='gr'/></c:when>
                    </c:choose>
                </div>
            </div>

            <c:choose>
                <c:when test="${merchant.mainType eq 1}">
                    <div class="layui-row layui-col-space30">

                        <div class="layui-col-md6">

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='gsmc'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                        ${merchant.merchantEnterpriseInfo.company}
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='frxm'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                        ${merchant.merchantEnterpriseInfo.legalPersonRealname}
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='qy2'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                        ${merchant.merchantEnterpriseInfo.province} ${merchant.merchantEnterpriseInfo.city} ${merchant.merchantEnterpriseInfo.area}
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='frsfzzm'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                    <c:if test="${not empty merchant.merchantEnterpriseInfo.legalPersonIdCardPhoto}">
                                        <img src="${store_domain}/uploads/${merchant.merchantEnterpriseInfo.legalPersonIdCardPhoto}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                    <c:if test="${empty merchant.merchantEnterpriseInfo.legalPersonIdCardPhoto}">
                                        <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                </div>
                            </div>


                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='gsyyzz'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                    <c:if test="${not empty merchant.merchantEnterpriseInfo.businessLicensePhoto}">
                                        <img src="${store_domain}/uploads/${merchant.merchantEnterpriseInfo.businessLicensePhoto}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                    <c:if test="${empty merchant.merchantEnterpriseInfo.businessLicensePhoto}">
                                        <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                </div>
                            </div>

                        </div>
                        <div class="layui-col-md6">

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='yyzzhm'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                        ${merchant.merchantEnterpriseInfo.businessLicenseNo}
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='frsfz'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                        ${merchant.merchantEnterpriseInfo.legalPersonIdCardNo}
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='dz'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                        ${merchant.merchantEnterpriseInfo.address}
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='frsfzfm'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                    <c:if test="${not empty merchant.merchantEnterpriseInfo.legalPersonIdCardPhotoBack}">
                                        <img src="${store_domain}/uploads/${merchant.merchantEnterpriseInfo.legalPersonIdCardPhotoBack}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                    <c:if test="${empty merchant.merchantEnterpriseInfo.legalPersonIdCardPhotoBack}">
                                        <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                </div>
                            </div>


                        </div>
                    </div>
                </c:when>
                <c:when test="${merchant.mainType eq 2}">
                    <div class="layui-row layui-col-space30">

                        <div class="layui-col-md6">

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='xm'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                        ${merchant.merchantIndividualInfo.legalPersonRealname}
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='ssdq'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                        ${merchant.merchantIndividualInfo.province} ${merchant.merchantIndividualInfo.city} ${merchant.merchantIndividualInfo.area}
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='yyzzhm'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                        ${merchant.merchantIndividualInfo.businessLicenseNo}
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='sfzzm'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                    <c:if test="${not empty merchant.merchantIndividualInfo.idCardPhoto}">
                                        <img src="${store_domain}/uploads/${merchant.merchantIndividualInfo.idCardPhoto}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                    <c:if test="${empty merchant.merchantIndividualInfo.idCardPhoto}">
                                        <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='yyzz'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                    <c:if test="${not empty merchant.merchantIndividualInfo.businessLicensePhoto}">
                                        <img src="${store_domain}/uploads/${merchant.merchantIndividualInfo.businessLicensePhoto}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                    <c:if test="${empty merchant.merchantIndividualInfo.businessLicensePhoto}">
                                        <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                </div>
                            </div>

                        </div>
                        <div class="layui-col-md6">

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='sfz'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                        ${merchant.merchantIndividualInfo.idCardNo}
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='dz'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                        ${merchant.merchantIndividualInfo.address}
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='sfzfm'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                    <c:if test="${not empty merchant.merchantIndividualInfo.idCardPhotoBack}">
                                        <img src="${store_domain}/uploads/${merchant.merchantIndividualInfo.idCardPhotoBack}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                    <c:if test="${empty merchant.merchantIndividualInfo.idCardPhotoBack}">
                                        <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                </div>
                            </div>

                        </div>
                    </div>
                </c:when>
                <c:when test="${merchant.mainType eq 3}">

                    <div class="layui-row layui-col-space30">

                        <div class="layui-col-md6">

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='xm'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                        ${merchant.merchantPersonalInfo.legalPersonRealname}
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='ssdq'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                        ${merchant.merchantPersonalInfo.province} ${merchant.merchantPersonalInfo.city} ${merchant.merchantPersonalInfo.area}
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='sfzzm'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                    <c:if test="${not empty merchant.merchantPersonalInfo.legalPersonIdCardPhoto}">
                                        <img src="${store_domain}/uploads/${merchant.merchantPersonalInfo.legalPersonIdCardPhoto}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                    <c:if test="${empty merchant.merchantPersonalInfo.legalPersonIdCardPhoto}">
                                        <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                </div>
                            </div>

                        </div>
                        <div class="layui-col-md6">

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='sfzhm'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                        ${merchant.merchantPersonalInfo.idCardNo}
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='dz'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                        ${merchant.merchantPersonalInfo.address}
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label"><fmt:message key='sfzfm'/></label>
                                <div class="layui-form-mid layui-word-aux">
                                    <c:if test="${not empty merchant.merchantPersonalInfo.legalPersonIdCardPhotoBack}">
                                        <img src="${store_domain}/uploads/${merchant.merchantPersonalInfo.legalPersonIdCardPhotoBack}" class="preview" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                    <c:if test="${empty merchant.merchantPersonalInfo.legalPersonIdCardPhotoBack}">
                                        <img src="${web_domain}/resources/images/default.jpeg" style="width:120px;height:120px;margin-top:10px;">
                                    </c:if>
                                </div>
                            </div>

                        </div>
                    </div>

                </c:when>
            </c:choose>

            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                <legend><fmt:message key='shxx'/></legend>
            </fieldset>


            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='tssj'/></label>
                <div class="layui-form-mid layui-word-aux">
                    <fmt:formatDate value="${merchant.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='shzt'/></label>
                <div class="layui-form-mid layui-word-aux">
                    <c:choose>
                        <c:when test="${merchant.merchantCheckStatus eq 1}"><fmt:message key='shz'/></c:when>
                        <c:when test="${merchant.merchantCheckStatus eq 2}"><fmt:message key='shtg'/></c:when>
                        <c:when test="${merchant.merchantCheckStatus eq 3}"><fmt:message key='shbtg'/></c:when>
                    </c:choose>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='shjg'/></label>
                <div class="layui-input-inline" style="width:70%;">
                    <input type="radio" name="merchantCheckStatus" value="2" title="<fmt:message key='shtg'/>"/>
                    <input type="radio" name="merchantCheckStatus" value="3" title="<fmt:message key='shbtg'/>"/>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><fmt:message key='shbz'/></label>
                <div class="layui-input-inline" style="width:80%;">
                    <form:textarea path="merchantCheckNote" calss="layui-input" style="height:100px;width:100%"/>
                </div>
            </div>

            <div class="layui-input-block">
                <div style="display: none"><input type="button" value="<fmt:message key='bc'/>" class="layui-btn" id="submit" lay-filter="submit" lay-submit></div>
            </div>


        </form:form>
    </div>
</div>

<script>

    $(function () {
        layui.use(['form'], function () {

            var form = layui.form;

            form.on('submit(submit)', function (data) {

                var merchantCheckStatus = $(":radio[name='merchantCheckStatus']:checked").val();

                if (!merchantCheckStatus) {
                    layui.use('layer', function () {
                        layer.msg("<fmt:message key='qqrshzt'/>");
                    });

                    return false;
                }

                $("#form").ajaxSubmit({
                    success: function (result) {
                        if (result.status) {
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                            parent.$("#search").click();
                        } else {
                            layer.msg(result.message);
                        }
                    }
                });
            });


        });
    });
</script>
</body>
</fmt:bundle>
</html>